<template>
	<view class="content">
		<view class="top">
			<view class="topitem">
				<view style="display: flex;">
					<image :src="userinfo.avater" mode=""></image>
					<view class="info">
						<view class="name">{{ userinfo.name }}</view>
						<view style="font-size: 14px;font-weight: bold;">{{ userinfo.phone }}</view>
					</view>
				</view>
				<view>
					<uni-badge style="margin-right: 10px;" class="uni-badge-left-margin" :is-dot="true" :text="value"
						absolute="rightTop" size="small">
						<uni-icons type="notification" size="30"></uni-icons>
					</uni-badge>
					<uni-icons @click="Goto('/pages/setting/setting')" type="gear" size="30"></uni-icons>
				</view>
			</view>
			<view class="topitem topbut" style="margin: 10px 0;">
				<view>总资产（币）</view>
				<view class="butt">提现<uni-icons type="right" size="18" color="#fff"></uni-icons></view>
			</view>
			<view class="topitem topbut">
				<view style="font-size: 30px;">4,056,89</view>
				<view class="butt">收支明细<uni-icons type="right" size="18" color="#fff"></uni-icons></view>
			</view>
		</view>
		<view class="card">
			<view class="carditem">
				<view class="itemtop">
					<text class="icon"></text>
					<text class="font">
						回收订单
					</text>
				</view>
				<view class="itembut">
					<view class="butone">
						<uni-icons type="camera" size="30"></uni-icons>
						<text>待接单</text>
					</view>
					<view class="butone">
						<uni-icons type="paperplane" size="30"></uni-icons>
						<text>已接单</text>
					</view>
					<view class="butone">
						<uni-icons type="vip" size="30"></uni-icons>
						<text>收货中</text>
					</view>
					<view class="butone">
						<uni-icons type="gift" size="30"></uni-icons>
						<text>已完成</text>
					</view>
				</view>
			</view>
			<view class="carditem">
				<view class="itemtop">
					<text class="icon"></text>
					<text class="font">
						兑换订单
					</text>
				</view>
				<view class="itembut">
					<view class="butone">
						<uni-icons type="map" size="30"></uni-icons>
						<text>待支付</text>
					</view>
					<view class="butone">
						<uni-icons type="images" size="30"></uni-icons>
						<text>待取货</text>
					</view>
					<view class="butone">
						<uni-icons type="mail-open" size="30"></uni-icons>
						<text>配送中</text>
					</view>
					<view class="butone">
						<uni-icons type="hand-up" size="30"></uni-icons>
						<text>已完成</text>
					</view>
				</view>
			</view>
		</view>
		<view class="card">
			<view class="carditem">
				<view class="itemtop">
					<text class="font">
						常用功能
					</text>
				</view>
				<view class="itembut">
					<view class="butone">
						<uni-icons type="star" size="30"></uni-icons>
						<text>我的收藏</text>
					</view>
					<view class="butone">
						<uni-icons type="map" size="30"></uni-icons>
						<text>足迹</text>
					</view>
					<view class="butone">
						<image class="icon" src="../../../static/icon/勋章.png" mode=""></image>
						<text>我的贡献</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		onShow,
		onHide,
		onUnload
	} from '@dcloudio/uni-app'
	export default {
		data() {
			return {
				value: 1,
				userinfo: {
					name: "",
					phone: "",
					avater: ""
				}
			};
		},
		onShow() {
			let userinfo = uni.getStorageSync("userinfo")
			if (userinfo) {
				this.userinfo = userinfo
			} else {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			}

		},
		methods: {
			Goto(path) {
				uni.navigateTo({
					url: path
				})
			}
		}
	};
</script>


<style scoped lang="scss">
	.content {
		height: 100vh;
	}

	.icon {
		width: 30px;
		height: 30px;
	}

	.top {
		background-color: #2bcddd;
		height: 150px;
		border-radius: 0 0 10px 10px;
		padding: 15px;
		padding-bottom: 0;
		color: #fff;
	}

	.topitem {
		display: flex;
		justify-content: space-between;

		image {
			width: 50px;
			height: 50px;
			border-radius: 50%;
			margin-right: 10px;
		}

		.info {
			width: 100px;
			.name{
				font-size: 20px;
				font-weight: bold;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
		}
	}

	.topbut {
		line-height: 30px;

		.butt {
			height: 30px;
			padding: 0 20px;
			background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
			border-radius: 20px 0 0 20px;
			border: none;
		}

	}

	.card {
		border-radius: 20px;
		margin-top: -10px;
		background-color: #fff;
		padding: 15px;
	}

	.carditem {
		margin-bottom: 30px;

		.itemtop {
			.icon {
				display: inline-block;
				width: 5px;
				height: 30px;
				background-color: #ff5e81;
				vertical-align: middle;
			}

			.font {
				font-size: 20px;
				font-weight: bold;
			}
		}

		.itembut {
			margin-top: 20px;
			display: grid;
			grid-template-columns: repeat(4, 70px);
			justify-content: space-between;

			.butone {
				display: flex;
				flex-direction: column;
				align-items: center;
			}
		}
	}
</style>